package com.String;

import java.util.Scanner;

/*
判断大小写字幕的数量
*/
public class Demo05 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入一个包含大小写的字符串：");
        String str = sc.next();
        char[] arr = str.toCharArray();
        int bigStr = 0;
        int smallStr = 0;
        for (int i = 0; i < arr.length; i++) {
            if (arr[i] >= 'a' && arr[i] <= 'z') {
                smallStr++;
            } else if (arr[i] >= 'A' && arr[i] <= 'Z') {
                bigStr++;
            }
        }
        System.out.println("大写字母有" + bigStr + "个，小写字母有" + smallStr);
    }
}
